The present invention relates to an image processing apparatus and method and, more particularly, to an image processing apparatus and method for processing an image on the basis of the edge vectors of the image.
In association with an apparatus and method for painting a portion inside a closed figure expressed by edge vector data, which are obtained by expressing the edge shape of a binary image by vectors (coordinate values), the present applicant proposed Japanese Patent Laid-Open Nos. 5-20466, 5-20467, 5-20468, and 5-40831. The technique disclosed in each of these references paints pixels located on an edge boundary line while considering these pixels as those present inside the closed figure.
In association with an apparatus and method for extracting edge vectors obtained on the lattice between pixels serving as a boundary between black and white pixel regions of a binary image, the present applicant proposed Japanese Patent Laid-Open Nos. 4-157578 and 5-108823.
In Japanese Patent Laid-Open No. 5-174140, the present applicant discloses an apparatus which can realize independent vertical and horizontal stepless variable-magnification operations of a binary image by comprising a means for performing variable-magnification processing of an image using extracted edge vectors in addition to the above-mentioned means for extracting edge vectors and the means for painting a portion inside a closed figure.
However, with the method disclosed in Japanese Patent Laid-Open No. 5-174140, upon execution of variable-magnification processing at a low magnification factor of about .times.1 to .times.2, the generated output image often has a relatively large pixel width in a thin line portion. For this reason, the present applicant proposed an improved edge vector extraction method and an image variable-magnification processing method in Japanese Patent Laid-Open No. 6-12490.
In addition to the vector extraction method which can improve variable-magnification processing at a low magnification factor disclosed in Japanese Patent Laid-Open No. 6-12490 above, the present applicant proposed an edge vector smoothing/variable-magnification processing method based on a vector format in Japanese Patent Laid-Open No. 6-337931.
The conventional problem, i.e., a phenomenon associated with an increase in line width of a black pixel region upon execution of variable-magnification processing at a low magnification factor as the problem of the invention disclosed in Japanese Patent Laid-Open No. 5-174140, the result disclosed in Japanese Patent Laid-Open No. 6-12490 as an improved invention of the former invention, and problems remaining unsolved in Japanese Patent Laid-Open No. 6-12490 will be explained below with reference to FIGS. 2 to 9H.
First, symbols commonly used in FIGS. 2 to 9H will be explained. A relatively large circular mark (e.g., 200) represents a black pixel of a binary image. A relatively small circular mark (e.g., 201 represents the position of the start point of a horizontal vector of edge vectors that express a boundary of black and white pixel region of a binary image, and a triangular mark (e.g., 202) represents the position of the start point of a vertical vector of the edge vectors. Arrows represent the directions of these horizontal and vertical vectors.
FIG. 2 shows an example of an input image (digital binary image) as an object to be subjected to stepless variable-magnification processing according to Japanese Patent Laid-Open No. 5-174140. This input image is a rectangle surrounded by 1-pixel wide straight lines and defined by an outer frame of 5 pixels in the horizontal direction .times.6 pixels in the vertical direction, and an inner frame of 3 pixels in the horizontal direction .times.4 pixels in the vertical direction. Edge vectors extracted using the vector extraction method disclosed in Japanese Patent Laid-Open No. 5-174140 (i.e., the vector extraction method according to Japanese Patent Laid-Open No. 4-157578) are vector groups forming two loops (closed figures), i.e., the outer frame of 5 pixels in the horizontal direction .times.6 pixels in the vertical direction, and the inner frame of 3 pixels in the horizontal direction .times.4 pixels in the vertical direction.
FIG. 3 shows an enlarged image obtained after variable-magnification processing (.times.2.0 in the horizontal direction, .times.2.0 in the vertical direction) according to Japanese Patent Laid-Open No. 5-174140 is performed for the above-mentioned input image. First, the x-coordinate values (horizontal direction) and y-coordinate values (vertical direction) of the start coordinates of the edge vectors constituting the above-mentioned input image (the outer frame vector loop of 5 pixels in the horizontal direction .times.6 pixels in the vertical direction and the inner frame vector loop of 3 pixels in the horizontal direction .times.4 pixels in the vertical direction) are multiplied with magnification factors in the respective directions (in this case, 2.0 in both the vertical and horizontal directions), thereby obtaining an outer frame vector loop of 10 pixels in the horizontal direction .times.12 pixels in the vertical direction, and an inner frame vector loop of 6 pixels in the horizontal direction .times.8 pixels in the vertical direction.
Subsequently, using a painting method according to one of Japanese Patent Laid-Open Nos. 5-20467, 5-20466, 5-20468, 5-40831, and the like, a portion sandwiched between the outer and inner frames including vector loop edge lines after the variable-magnification processing is painted, thereby obtaining the image shown in FIG. 3 after the variable-magnification processing.
The image shown in FIG. 3 after the variable-magnification processing is a rectangle surrounded by 3-pixel wide straight lines and defined by an outer frame of 11 pixels in the horizontal direction .times.13 pixels in the vertical direction, and an inner frame of 5 pixels in the horizontal direction .times.7 pixels in the vertical direction. Theoretically, an ideal image obtained by enlarging the above-mentioned input image (FIG. 2) to .times.2.0 in the vertical and horizontal directions must become a rectangle surrounded by 2-pixel wide straight lines and defined by an outer frame of 10 pixels in the horizontal direction .times.12 pixels in the vertical direction and an inner frame of 6 pixels in the horizontal direction .times.8 pixels in the vertical direction, as shown in FIG. 5. However, the enlarged image shown in FIG. 3 is generated to have a larger pixel region than the ideal image.
FIG. 4 shows an enlarged image which is obtained by similarly enlarging the input image to .times.4.0 in both the vertical and horizontal directions and painting its inner portion. This enlarged image is also generated to have a larger black pixel region than an ideal image since a 5-pixel wide rectangle is reproduced by an outer frame vector loop of 20 pixels in the horizontal direction .times.24 pixels in the vertical direction and an inner frame vector loop of 12 pixels in the horizontal direction .times.16 pixels in the vertical direction.
On the other hand, FIG. 5 shows edge vector data obtained by applying an improved vector extraction method according to Japanese Patent Laid-Open No. 6-12490 to an input image identical to the above-mentioned input image (FIG. 2). In this case, an outer frame is extracted as a vector loop of 4.5 pixels in the horizontal direction .times.5.5 pixels in the vertical direction, and an inner frame is extracted as a vector loop of 3.5 pixels in the horizontal direction and 4.5 pixels in the vertical direction. When the x-coordinate values (horizontal direction) and y-coordinate values (vertical direction) of the start point coordinates of the edge vectors constituting the inner and outer frame vector loops shown in FIG. 5 are multiplied with 2.0 in both the vertical and horizontal directions as the magnification factors in the respective directions, an outer frame vector loop of 9 pixels in the horizontal direction .times.11 pixels in the vertical direction and an inner frame vector loop of 7 pixels in the horizontal direction .times.9 pixels in the vertical direction are obtained.
Subsequently, using a painting method according to one of Japanese Patent Laid-Open Nos. 5-20467, 5-20466, 5-20468, 5-40831, and the like, a portion sandwiched between the outer and inner frames including pixels on edge lines expressed by the enlarged vector loops is painted, thereby obtaining an ideal enlarged image shown in FIG. 5. In this manner, an ideal enlarged image with a theoretical pixel width can be obtained for enlargement at a relatively low magnification factors of about .times.2.0 by the vector extraction method and image processing method according to Japanese Patent Laid-Open No. 6-12490.
However, at a magnification factor of, e.g., .times.4.0 larger than .times.2.0, an enlarged image having a pixel width smaller than an theoretical pixel width is reproduced, contrary to the image shown in FIG. 3. When the vector loops shown in FIG. 5 are multiplied with .times.4.0 in both the vertical and horizontal directions, the outer frame is enlarged to a vector loop of 18 pixels in the horizontal direction .times.22 pixels in the vertical direction, and the inner frame is enlarged to a vector loop of 14 pixels in the horizontal direction .times.18 pixels in the vertical direction. Even when this image is painted using the above-mentioned painting method, a rectangle with a 3-pixel wide frame is obtained, and the pixel width of the enlarged image is thinner by one pixel than that of an ideal image with a 4-pixels wide frame.
When the enlargement magnification factor is relatively large (e.g., .times.5 to .times.10), even when black pixels are reproduced to be thicker/thinner by about one pixel than ideal ones, the relative difference from an ideal enlarged image is small, and the visual disadvantage is negligible. Such a difference may even be considered as an effect of allowing easy recognition of a line image. However, when the enlargement magnification factor is relatively small (e.g., .times.1 to .times.4), the visual disadvantage such as an unnatural feeling is serious even by an increase/decrease in one pixel, and a fine character or line image may be undesirably painted.
As described above, according to the inventions disclosed in the above-mentioned applications by the present applicant, a reproduced image with an ideal pixel width can be obtained with a predetermined magnification range, but an image may be reproduced to be thicker or thinner by one pixel than an ideal pixel width in other magnification ranges.
The present invention has been made in consideration of the above-mentioned problems and has as its object to suppress deformation of an image processed based on edge vectors.